<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>循环</title>
</head>
<body>
    
</body>
<script>
    var sum = 0;
    for (let index = 1; index <= 100; index++) {
        // sum = sum + index;
        sum += index;
    }
    console.log(sum);

    var d=new Date().getDay(); 
    switch (d) 
    { 
        case 0:x="今天是星期日"; 
        break; 
        case 1:x="今天是星期一"; 
        break; 
        case 2:x="今天是星期二"; 
        break; 
        case 3:x="今天是星期三"; 
        break; 
        case 4:x="今天是星期四"; 
        break; 
        case 5:x="今天是星期五"; 
        break; 
        case 6:x="今天是星期六"; 
        break; 
    }
    console.log(x)
</script>
</html>